﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="~/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav aui-text-left header" id="header">
        <br />
        <h1>
            <a class="aui-btn aui-pull-right" tapmode onclick="openClub()">
                <i class="aui-iconfont aui-icon-mobile"></i>
            </a>
            确认预约
        </h1>
    </header>
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-form-list">
            @if (ViewData["Appointmentable"].ToString() == "Yes")
            {

                <li class="aui-list-header">点击要预约的时间即可预约</li>
                @model IEnumerable<Appointmentlist>
                @foreach (var item in Model)
                {
                    if (item.appointment != "0000000") {
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">
                                    <i class="aui-iconfont aui-icon-calendar"></i>&nbsp;&nbsp;@Html.DisplayFor(modelItem => item.dateTime)
                                </div>
                                <div>
                                   <a href="/Vip/Appointment2?aid=@item.aid&date=@item.dateTime&doctorname=@ViewData["doctorname"]&appointment=@item.appointment">
                                       <!--<a href="/Vip/Formpost?aid=item.aid&date=item.dateTime&time=1&doctorname=ViewData["doctorname"]">-->
                                    <div class="aui-btn aui-btn-info aui-btn-default"><font color="#FFFFFF">选择</font></div>
                                    </a>
                                </div>
                            </div>
                        </li>}


                }
            }
            else
            {
                <script type="text/javascript" src="~/script/aui-dialog.js"></script>
                <script type="text/javascript" src="~/script/api.js"></script>
                <script type="text/javascript">

                    var dialog = new auiDialog({})
                    window.onload = function () {
                        dialog.alert({
                            title: "温馨提示",
                            msg: '您已经有此医生的未取号预约<p>不可再次预约此医生</p>',
                            buttons: ['查看我的预约', '选择其他医生']
                        }, function (ret) {
                            if (ret.buttonIndex == 2) {
                                window.location.href = "/Vip/DoctorChoose?classnum=@ViewData["classnumber"]";
                            }
                            else window.location.href = "/Vip/My"
                            console.log(ret)
                        })
                    }

                    apiready = function () {
                        api.setStatusBarStyle({
                            style: 'light'
                        });
                        api.parseTapmode();
                        var header = $api.byId('header');
                        var headerPos = $api.offset(header);
                        var body_h = $api.offset($api.dom('body')).h;
                        var header_h = $api.offset($api.byId('header')).h;
                        api.openFrame({
                            name: 'index_frm',
                            url: '~/html/index_frm.html',
                            bounces: true,
                            rect: {
                                x: 0,
                                y: header_h,
                                w: 'auto',
                                h: 'auto'
                            }
                        })
                    };
                    function openClub() {
                        var delay = 0;
                        if (api.systemType != 'ios') {
                            delay = 300;
                        }
                        api.openWin({
                            name: 'club_win',
                            url: '~/html/club_win.html',
                            bounces: false,
                            delay: delay,
                            slidBackEnabled: true,
                            vScrollBarEnabled: false,
                            progress: {
                                type: "page"
                            }
                        });
                    }
                    function closeWin() {
                        api.closeWin({
                        });
                    }
                </script>
            }

</body>
        </html>
        

